//
//  ViewController.m
//  HomeWork-20
//
//  Created by 鹏飞罗 on 16/8/10.
//  Copyright © 2016年 罗鹏飞. All rights reserved.
//

#import "ViewController.h"
#import "XMLReader.h"
#import "GDataXMLNode.h"
@interface ViewController ()
@property (nonatomic, strong)NSMutableArray *AlbumInfoArray;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
}
#pragma mark - NSReader
- (IBAction)NSReaderClicked:(id)sender {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Cartoon" ofType:@"xml"];
    NSData *XMLData = [NSData dataWithContentsOfFile:path];
    NSError *error = nil;
    NSDictionary *redaerDic = [XMLReader dictionaryForXMLData:XMLData error:&error];
    NSLog(@"%@",redaerDic);
}
- (IBAction)SAXClicked:(id)sender {
    
    
}
- (IBAction)DOMCilcked:(id)sender {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Cartoon" ofType:@"xml"];
    NSData *XMLData = [NSData dataWithContentsOfFile:path];
    NSError *error = nil;
//    树
    GDataXMLDocument *document = [[GDataXMLDocument alloc] initWithData:XMLData options:0 error:&error];
//   根节点
    GDataXMLElement *rootElement = document.rootElement;
//   获取子节点
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
